<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
	if(session.getAttribute("id")!=null){
		response.sendRedirect("inform.jsp");
	}
 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>注册</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	 
	 <link href="css/bootstrap.css" rel="stylesheet">
  </head>
  <script src="js/jquery2.2.3.js"></script>
  <script src="js/bootstrap.js"></script>
  <script type="text/javascript">
  function check()
 {
  var username = document.getElementById('form-username');
  var password1 = document.getElementById('form-password1');
  var password2 = document.getElementById('form-password2');
  if( username.value == ""||password1.value==""||password2.value=="" )
  {
   alert('请输入内容');
   return false;
  }
  else if(password1.value!=password2.value){
  alert('两次密码不一致！');
  return false;
  }
  else{
  	return true;
  }
 }
  </script>
  <body>
     <nav class="navbar navbar-default" role="navigation">
   <div class="navbar-header">
      <a class="navbar-brand" href="index.jsp">电影网</a>
   </div>
    <div>
      <ul class="nav navbar-nav">
         <li><a href="movie.jsp">所有电影</a></li>
         <li><a href="inform.jsp">我的电影</a></li> 
      </ul>
      <ul class="nav navbar-nav navbar-right">
         <li><a href="login.jsp">登录</a></li>
         <li><a href="register.jsp">注册</a></li>   
      </ul>
</div>

</nav>
  	<div class="top-content">
        <div class="inner-bg">
            <div class="container">
                 <div class="row">
                      <div class="col-sm-8 col-sm-offset-3 text">
                           <h1><strong>注册</strong></h1>
                       </div>
                </div>
         <div class="row">
         		<div class="col-sm-6 col-sm-offset-3 form-box">
                      <div class="form-top">
                      		<div class="form-top-left">
                        		<h3>欢迎注册电影网！</h3>
                            
                            </div>   	
                      </div>
					  <div class="form-bottom">
				      		<form action="servlet/RegServlet" method="post" class="reg-form" id="reg-form">
				      			<div class="form-group">
				    				<label class="sr-only" for="form-username">Username</label>
				    				<input type="text" name="username" placeholder="请输入用户名" class="form-username form-control" id="form-username">
				    		    </div>
				     <div class="form-group">
				     		<label class="sr-only" for="form-password">Password</label>
				     		<input type="password" name="password" placeholder="请设置密码" class="form-password form-control" id="form-password1">
				     </div>
				     <div class="form-group">
				     		<label class="sr-only" for="form-password">Password</label>
				     		<input type="password" name="passwordcommit" placeholder="请确认密码" class="form-password form-control" id="form-password2">
				     </div>
				<button type="submit" onclick="return check()" class="btn">注册</button>
				</form>
   							</div>
                		</div>
					</div>
                </div>
            </div>     
        </div>

  </body>
</html>
